package leecode

import "math"

func minimumSubarrayLength(nums []int, k int) int {
	result := math.MaxInt
	for i := 0; i < len(nums); i++ {
		temp := 0
		for j := i; j < len(nums); j++ {
			temp = temp | nums[j]
			if temp >= k {
				result = min(result, j-i+1)
			}
		}
	}
	if result == math.MaxInt {
		return -1
	}
	return result
}
